<template>
  <div class="rewardContainer">
    ceshi
  </div>
</template>

<script>
export default {
  name: 'RewardCard',
  data() {
    return {
      id: '',
      list: [],
      sortList: [],
    }
  },
  methods: {
    async goLogin() {
      console.log('login ing');
      let res = await new Promise((resolve) => {
        setTimeout(() => {
          resolve('loginSucess');
        }, 3000);
      });
      this.id = res;
      console.log('res', res);
    },
    async getList() {
      console.log('id', this.id);
      let res = new Promise((resolve) => {
        setTimeout(() => {
          resolve([1,7,0,3])
          // console.log('GETlISTsUCCESS');
        },3000);
      });
      return res;
    },
    async getSort() {

    },
  },
  async mounted() {
    /**
     * await之后，会等待后面的async中的串行代码都执行完成，才会接着向下走
     */
    // 先登录，拿到登录的结果，请求列表，拿到列表数据排序
    await this.goLogin();
    const res = await this.getList();
    console.log('getList', res)
  }, 
}
</script>

<style lang="scss" scoped src='./index.scss'>

</style>